require 'View/UIBase/UIBase'
require "Common/define"
require "Logic/Config"
require "Common/functions"
local UIGuildRecommondSkin = require "View/UIGuild/Skin/UIGuildRecommondSkin"

UIGuildRecommond = UIBase.New(PanelResNames.UIGuildRecommond);

function UIGuildRecommond.Init(func)
    UIBase.Init(UIGuildRecommond, func);
end

---@param obj GComponent
function UIGuildRecommond:OnCreate()
    --AddUIPackageDepend(PanelResNames.UIGuildRecommond,"FUI/UIGuildMap")
    self.viewSkin = UIGuildRecommondSkin.New(self.fguiObj);
    self.viewSkin:setCloseCallback(function() self:OnBack() end);
end

function UIGuildRecommond:OnBack()
    if logicMgr.GuildManager.unionInfo and not isOpenUI(PanelNames.UIGuildPanel)then
        showUI(PanelNames.UIGuildPanel);
    end
    DestoryUI(PanelNames.UIGuildRecommond);
end

function UIGuildRecommond:OnDestroy()
    self.viewSkin:OnDestroy();
    --if UIPackage.GetById("FUI/UIGuildMap") then
    --    UIPackage.RemovePackage("FUI/UIGuildMap")
    --end
end

return UIGuildRecommond;